Skip to content

feat(agents): a Claude Code status line that follows the Omarchy theme - #16

Merged
phmatray merged 2 commits into
mainfrom
feat/claude-statusline
Sep 5, 2026
Merged

feat(agents): a Claude Code status line that follows the Omarchy theme#16
phmatray merged 2 commits into
mainfrom
feat/claude-statusline

Conversation

@phmatray

@phmatray phmatray commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

The bottom bar for the Claude Code CLI, in two lines: where you are (model, effort, worktree, branch, uncommitted count, open PR and review state), then what it costs (context gauge, 5-hour and 7-day quota windows, spend, lines changed). Every value comes from the JSON Claude Code puts on the command's stdin — no API poll, no gh call, no transcript parsing.

Why it belongs here rather than being one more npm status line: it paints with the sixteen ANSI colors and nothing else. The palette then comes from the terminal, so the bar re-themes itself when Omarchy switches theme or flips light/dark — exactly how starship and bat already behave on this machine. Truecolor would have meant a theme-set.d hook and a second copy of the palette to keep in sync.

It stays quiet: a quota window appears at 25 %, a cost at $0.10, the diff only when non-zero. A fresh session shows two short lines.

Two things it would be wrong without:

  • Nerd Font icons come from the non-Mono family and occupy two cells, so the width budget counts them as two.
  • COLUMNS is not exported to the status line command, and tput cols answers 80 whenever stdout is a pipe — which is always. Falling back to tput truncated a wide bar at 80; the fallback is a generous 200 instead.

It also drops each session's context percentage in $XDG_RUNTIME_DIR/macarchy-claude/<session id>, which macarchy/macarchy-touchbar#claude-context reads to put the fullest session on the Touch Bar. A no-op when nothing reads it.

Test

bash agents/claude-statusline.sh --test — thresholds, the gauge ramp, a quiet session, narrow-terminal truncation, the Touch Bar hand-off, and empty or invalid stdin.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TN4cPFxUtafhd87w2ZqY7R

The bottom bar for the Claude Code CLI, in two lines: where you are (model,
effort, worktree, branch, uncommitted count, open PR and its review state),
then what it costs (a context-window gauge, the 5-hour and 7-day quota
windows, session spend and lines changed). Everything it shows comes from the
JSON Claude Code writes to the command's stdin — no API poll, no `gh` call,
no transcript parsing.

It paints with the sixteen ANSI colors and nothing else. The palette then
comes from the terminal, so the bar re-themes itself when Omarchy switches
theme or flips light/dark, the same way starship and bat already do here.
Truecolor would have meant a theme-set hook and a second copy of the palette.

Two details the bar would be wrong without: Nerd Font icons come from the
non-Mono family and take two cells, so the width budget counts them as two;
and `COLUMNS` is not exported to the status line command while `tput cols`
answers 80 whenever stdout is a pipe, which is always, so a wide bar would
truncate at 80 — the fallback is a generous 200 instead.

`--test` is the self-check: thresholds, the gauge ramp, a quiet session,
narrow-terminal truncation, the Touch Bar hand-off, and empty or invalid
stdin.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TN4cPFxUtafhd87w2ZqY7R
The assertions shipped inside `claude-statusline.sh --test`, where nothing ran
them. This is the wrapper that makes `tests/*.sh` — the gate CI actually runs —
call it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TN4cPFxUtafhd87w2ZqY7R
@phmatray
phmatray merged commit 4d50566 into main Sep 5, 2026
1 check passed
@phmatray
phmatray deleted the feat/claude-statusline branch September 5, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant